package com.jlcindia.hibernate;
import java.util.Date;

import org.hibernate.*;
import org.hibernate.cfg.*;
public class Lab36 
{
	public static void main(String args[])
	{
		Transaction tx=null;
		try
		{
			SessionFactory sf=HibernateUtil.getSessionFactory();
			Session session=sf.openSession();
			tx=session.beginTransaction();
			//Request request = new Request("C-101", "Loss of card", new Date());
			//String st = (String)session.save(request);
			//System.out.println(st);
			Request request = (Request)session.load(Request.class, "402880ea43203bcf0143203bd1ab0000");
			request.setMessage("Ok Ok");
			tx.commit();
		}
		catch (Exception e) 
		{
			e.printStackTrace();
			if(tx!=null)
				tx.rollback();
		}
	}
}
